//
//  Global.h
//  Ghac 4S
//
//  Created by apple on 11-8-23.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ProgramCodeHelp.h"
#pragma once
#ifndef GLOBAL_CARTYPE
#define GLOBAL_CARTYPE      @"global_cartype"
#endif
#define ISDEBUG YES
@class Global;
@protocol MainViewSwitchAction <NSObject>

-(void)showInnerView:(UIViewController *)contentViewController;
-(void)backToEntryView;

@end

void KLog(NSString*, ...);

static NSDictionary*    g_config = nil;
static Global*          g_mainGlobal = nil;
enum UpdateTimeDelta
{
    RIGHTAWAY, DAYLY,WEEKLY,MONTHLY
};
enum HondaBand
{
    ACCORD08, ODYSSEY05, NEWFIT, CITY, ODYSSEY_NEW, CROSSTOUR, S1
};
@interface Global : NSObject
{
    enum UpdateTimeDelta    updateTimeDelta;
    NSArray*                m_carNameList;
    
}
@property (nonatomic, assign) enum UpdateTimeDelta updateTimeDelta;
+(NSString*) BTN_L_NEWS;
+(NSString*) BTN_L_LOCATION;
+(NSString*) BTN_L_PRICE;
+(NSString*) BTN_L_REPAIR;
+(NSString*) BTN_L_QA;
+(NSString*) BTN_L_CONTACT;
+(NSString*) SHOP_DETAIL_VIEW;

+(NSDictionary*) globalConfigDic;
+(Global*)          mainInstance;
+(id<MainViewSwitchAction>) mainRootController;

+(NSArray*) cartypeList;
+(NSArray*) carInfoList;
+(void)phoneCall:(NSString *)telNum;
@end


@interface NSMutableArray(sort)
-(void)simpleSort:(BOOL)ascending;
@end
@implementation NSMutableArray(sort)
-(void)simpleSort:(BOOL)ascending
{
    NSSortDescriptor* descriptor = [[NSSortDescriptor alloc] initWithKey:nil ascending:ascending];
    [self sortUsingDescriptors:[NSArray arrayWithObject:descriptor]];
    [descriptor release];
}
@end

